package com.cema.manage.project.manage.configuration.controller;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.cema.manage.framework.web.controller.BaseController;
import com.cema.manage.framework.web.domain.BaseEntity;
import com.cema.manage.framework.web.domain.Message;
import com.cema.manage.framework.web.page.TableDataInfo;
import com.cema.manage.project.enums.RedisEnum;
import com.cema.manage.project.manage.configuration.domain.Configuration;
import com.cema.manage.project.manage.configuration.service.IConfigurationService;
import com.cema.manage.redis.RedisService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;


/**
 * 常规配置 信息操作处理
 *
 * @author reasahi
 * @date 2024-07-22
 */
@Controller
@RequestMapping("/manage/configuration")
public class ConfigurationController extends BaseController {
    private String prefix = "manage/configuration";

    @Autowired
    private IConfigurationService configurationService;

    @Resource
    private RedisService redisService;

    @GetMapping("{id}")
    @RequiresPermissions("manage:configuration:view")
    public String configuration(@PathVariable("id") Integer id, Model model) {
        model.addAttribute(RedisEnum.APP_ID.getKey(), redisService.get(RedisEnum.APP_ID.getKey() + id));
        model.addAttribute(RedisEnum.TA_KU_APP_ID.getKey(), redisService.get(RedisEnum.TA_KU_APP_ID.getKey() + id));
        model.addAttribute(RedisEnum.TA_KU_APP_KEY.getKey(), redisService.get(RedisEnum.TA_KU_APP_KEY.getKey() + id));
        //GromMore-&gt;激励广告位-&gt;有回调
        model.addAttribute(RedisEnum.INCENTIVE_VIDEO_CALLBACK.getKey(), redisService.get(RedisEnum.INCENTIVE_VIDEO_CALLBACK.getKey() + id));
        model.addAttribute(RedisEnum.TA_KU_INCENTIVE_VIDEO_CALLBACK.getKey(), redisService.get(RedisEnum.TA_KU_INCENTIVE_VIDEO_CALLBACK.getKey() + id));
        //GromMore-&gt;激励广告位-&gt;无回调
        model.addAttribute(RedisEnum.INCENTIVE_VIDEO.getKey(), redisService.get(RedisEnum.INCENTIVE_VIDEO.getKey() + id));
        model.addAttribute(RedisEnum.TA_KU_INCENTIVE_VIDEO.getKey(), redisService.get(RedisEnum.TA_KU_INCENTIVE_VIDEO.getKey() + id));
        //分配比例（金币）
        model.addAttribute(RedisEnum.ALLOCATION_MONEY_GOLD_COIN.getKey(), redisService.get(RedisEnum.ALLOCATION_MONEY_GOLD_COIN.getKey() + id));
        //分配比例（红包）
        model.addAttribute(RedisEnum.ALLOCATION_MONEY_RED_PACKET.getKey(), redisService.get(RedisEnum.ALLOCATION_MONEY_RED_PACKET.getKey() + id));
        //广告时间间隔
        model.addAttribute(RedisEnum.TIME_INTERVAL.getKey(), redisService.get(RedisEnum.TIME_INTERVAL.getKey() + id));
        //banner广告
        model.addAttribute(RedisEnum.BANNER.getKey(), redisService.get(RedisEnum.BANNER.getKey() + id));
        model.addAttribute(RedisEnum.TA_KU_BANNER.getKey(), redisService.get(RedisEnum.TA_KU_BANNER.getKey() + id));
        //信息流
        model.addAttribute(RedisEnum.AD_INFORMATION_FLOW.getKey(), redisService.get(RedisEnum.AD_INFORMATION_FLOW.getKey() + id));
        model.addAttribute(RedisEnum.TA_KU_AD_INFORMATION_FLOW.getKey(), redisService.get(RedisEnum.TA_KU_AD_INFORMATION_FLOW.getKey() + id));
        //首页插屏广告控制N秒加载一次
        model.addAttribute(RedisEnum.MEDIATION_FULL_AD.getKey(), redisService.get(RedisEnum.MEDIATION_FULL_AD.getKey() + id));
        //GromMore激励视频回调密钥
        model.addAttribute(RedisEnum.AD_GM_SECRET_KEY.getKey(), redisService.get(RedisEnum.AD_GM_SECRET_KEY.getKey() + id));
        model.addAttribute(RedisEnum.TA_KU_AD_GM_SECRET_KEY.getKey(), redisService.get(RedisEnum.TA_KU_AD_GM_SECRET_KEY.getKey() + id));
        //开屏广告
        model.addAttribute(RedisEnum.SPREAD_ITS_TAIL.getKey(), redisService.get(RedisEnum.SPREAD_ITS_TAIL.getKey() + id));
        model.addAttribute(RedisEnum.TA_KU_SPREAD_ITS_TAIL.getKey(), redisService.get(RedisEnum.TA_KU_SPREAD_ITS_TAIL.getKey() + id));
        //插半屏广告
        model.addAttribute(RedisEnum.AD_INSERT_HALF_SCREEN.getKey(), redisService.get(RedisEnum.AD_INSERT_HALF_SCREEN.getKey() + id));
        model.addAttribute(RedisEnum.TA_KU_AD_INSERT_HALF_SCREEN.getKey(), redisService.get(RedisEnum.TA_KU_AD_INSERT_HALF_SCREEN.getKey() + id));
        //插全屏
        model.addAttribute(RedisEnum.AD_INSERT_FULL_SCREEN.getKey(), redisService.get(RedisEnum.AD_INSERT_FULL_SCREEN.getKey() + id));
        model.addAttribute(RedisEnum.TA_KU_AD_INSERT_FULL_SCREEN.getKey(), redisService.get(RedisEnum.TA_KU_AD_INSERT_FULL_SCREEN.getKey() + id));
        //支付宝网关
        model.addAttribute(RedisEnum.ZFB_URL.getKey(), redisService.get(RedisEnum.ZFB_URL.getKey() + id));
        //支付宝应用APPID
        model.addAttribute(RedisEnum.ZFB_APP_ID.getKey(), redisService.get(RedisEnum.ZFB_APP_ID.getKey() + id));
        //支付支付密钥
        model.addAttribute(RedisEnum.ZFB_SECRET_KEY.getKey(), redisService.get(RedisEnum.ZFB_SECRET_KEY.getKey() + id));
        //应用公钥证书文件路径
        model.addAttribute(RedisEnum.ZFB_APP_CERT_PATH.getKey(), redisService.get(RedisEnum.ZFB_APP_CERT_PATH.getKey() + id));
        //支付宝公钥证书文件路径
        model.addAttribute(RedisEnum.ZFB_ALIPAY_PUBLIC_CERT_PATH.getKey(), redisService.get(RedisEnum.ZFB_ALIPAY_PUBLIC_CERT_PATH.getKey() + id));
        //支付宝根证书文件路径
        model.addAttribute(RedisEnum.ZFB_ROOT_CERT_PATH.getKey(), redisService.get(RedisEnum.ZFB_ROOT_CERT_PATH.getKey() + id));
        model.addAttribute(RedisEnum.WITHDRAWAL_NUMBER.getKey(), redisService.get(RedisEnum.WITHDRAWAL_NUMBER.getKey() + id));
        model.addAttribute(RedisEnum.WITHDRAWAL_NUMBER_SIGN.getKey(), redisService.get(RedisEnum.WITHDRAWAL_NUMBER_SIGN.getKey() + id));
        //APP下载地址
        model.addAttribute(RedisEnum.DOWNLOAD_LINK.getKey(), redisService.get(RedisEnum.DOWNLOAD_LINK.getKey() + id));
        //每日任务次数。超过次数无法看激励视频
        model.addAttribute(RedisEnum.DAILY_TASK_FREQUENCY.getKey(), redisService.get(RedisEnum.DAILY_TASK_FREQUENCY.getKey() + id));
        //签到第1天
        model.addAttribute(RedisEnum.SIGN_IN_ONE.getKey(), redisService.get(RedisEnum.SIGN_IN_ONE.getKey() + id));
        //签到第2天
        model.addAttribute(RedisEnum.SIGN_IN_TWO.getKey(), redisService.get(RedisEnum.SIGN_IN_TWO.getKey() + id));
        //签到第3天
        model.addAttribute(RedisEnum.SIGN_IN_THREE.getKey(), redisService.get(RedisEnum.SIGN_IN_THREE.getKey() + id));
        //签到第4天
        model.addAttribute(RedisEnum.SIGN_IN_FOUR.getKey(), redisService.get(RedisEnum.SIGN_IN_FOUR.getKey() + id));
        //签到第5天
        model.addAttribute(RedisEnum.SIGN_IN_FIVE.getKey(), redisService.get(RedisEnum.SIGN_IN_FIVE.getKey() + id));
        //签到第6天
        model.addAttribute(RedisEnum.SIGN_IN_SIX.getKey(), redisService.get(RedisEnum.SIGN_IN_SIX.getKey() + id));
        //签到第7天
        model.addAttribute(RedisEnum.SIGN_IN_SEVEN.getKey(), redisService.get(RedisEnum.SIGN_IN_SEVEN.getKey() + id));
        //签到第8天
        model.addAttribute(RedisEnum.SIGN_IN_EIGHT.getKey(), redisService.get(RedisEnum.SIGN_IN_EIGHT.getKey() + id));
        //签到第9天
        model.addAttribute(RedisEnum.SIGN_IN_NINE.getKey(), redisService.get(RedisEnum.SIGN_IN_NINE.getKey() + id));
        //广告金币比例
        model.addAttribute(RedisEnum.ALLOCATION_AD.getKey(), redisService.get(RedisEnum.ALLOCATION_AD.getKey() + id));
        //SMTP服务器
        model.addAttribute(RedisEnum.MAIL_SMTP_HOST.getKey(), redisService.get(RedisEnum.MAIL_SMTP_HOST.getKey() + id));
        //SMTP用户名
        model.addAttribute(RedisEnum.MAIL_SMTP_USERNAME.getKey(), redisService.get(RedisEnum.MAIL_SMTP_USERNAME.getKey() + id));
        //SMTP密码
        model.addAttribute(RedisEnum.MAIL_SMTP_PASSWORD.getKey(), redisService.get(RedisEnum.MAIL_SMTP_PASSWORD.getKey() + id));
        //发件人邮箱
        model.addAttribute(RedisEnum.MAIL_FROM.getKey(), redisService.get(RedisEnum.MAIL_FROM.getKey() + id));
        //接收信息邮箱
        model.addAttribute(RedisEnum.YOUR_MAIL.getKey(), redisService.get(RedisEnum.YOUR_MAIL.getKey() + id));
        //ECPM发送通知（大于ecpm发送通知）
        model.addAttribute(RedisEnum.AD_ECPM.getKey(), redisService.get(RedisEnum.AD_ECPM.getKey() + id));
        //APP 开屏广告
        model.addAttribute(RedisEnum.APP_SPREAD_ITS_TAIL.getKey(), redisService.get(RedisEnum.APP_SPREAD_ITS_TAIL.getKey() + id));
        //激励视频（答题）
        model.addAttribute(RedisEnum.APP_ANSWER_INCENTIVE.getKey(), redisService.get(RedisEnum.APP_ANSWER_INCENTIVE.getKey() + id));
        //激励视频 (签到)
        model.addAttribute(RedisEnum.APP_ANSWER_SIGN_IN.getKey(), redisService.get(RedisEnum.APP_ANSWER_SIGN_IN.getKey() + id));
        //激励视频（提现）
        model.addAttribute(RedisEnum.APP_ANSWER_WITHDRAWAL.getKey(), redisService.get(RedisEnum.APP_ANSWER_WITHDRAWAL.getKey() + id));
        model.addAttribute(RedisEnum.APP_ANSWER_3.getKey(), redisService.get(RedisEnum.APP_ANSWER_3.getKey() + id));
        //全屏广告（副广）
        model.addAttribute(RedisEnum.APP_FULL_SCREEN.getKey(), redisService.get(RedisEnum.APP_FULL_SCREEN.getKey() + id));
        //信息流（答错）
        model.addAttribute(RedisEnum.APP_FLOW_ANSWER_INCORRECTLY.getKey(), redisService.get(RedisEnum.APP_FLOW_ANSWER_INCORRECTLY.getKey() + id));
        //信息流（答对）
        model.addAttribute(RedisEnum.APP_FLOW_ANSWER.getKey(), redisService.get(RedisEnum.APP_FLOW_ANSWER.getKey() + id));
        //信息流（奖励）
        model.addAttribute(RedisEnum.APP_FLOW_REWARD.getKey(), redisService.get(RedisEnum.APP_FLOW_REWARD.getKey() + id));
        //信息流（提现）
        model.addAttribute(RedisEnum.APP_FLOW_WITHDRAWAL.getKey(), redisService.get(RedisEnum.APP_FLOW_WITHDRAWAL.getKey() + id));
        //信息流（我的）
        model.addAttribute(RedisEnum.APP_FLOW_MY.getKey(), redisService.get(RedisEnum.APP_FLOW_MY.getKey() + id));
        model.addAttribute(RedisEnum.APP_FLOW_4.getKey(), redisService.get(RedisEnum.APP_FLOW_4.getKey() + id));
        model.addAttribute(RedisEnum.APP_FLOW_5.getKey(), redisService.get(RedisEnum.APP_FLOW_5.getKey() + id));
        //插屏（提现）
        model.addAttribute(RedisEnum.APP_TABLE_PLAQUE_WITHDRAWAL.getKey(), redisService.get(RedisEnum.APP_TABLE_PLAQUE_WITHDRAWAL.getKey() + id));
        //APP Banner
        model.addAttribute(RedisEnum.APP_BANNER.getKey(), redisService.get(RedisEnum.APP_BANNER.getKey() + id));
        model.addAttribute(RedisEnum.APP_BANNER_1.getKey(), redisService.get(RedisEnum.APP_BANNER_1.getKey() + id));
        model.addAttribute(RedisEnum.APP_BANNER_2.getKey(), redisService.get(RedisEnum.APP_BANNER_2.getKey() + id));
        model.addAttribute(RedisEnum.APP_BANNER_3.getKey(), redisService.get(RedisEnum.APP_BANNER_3.getKey() + id));
        model.addAttribute(RedisEnum.APP_BANNER_4.getKey(), redisService.get(RedisEnum.APP_BANNER_4.getKey() + id));
        model.addAttribute(RedisEnum.APP_BANNER_5.getKey(), redisService.get(RedisEnum.APP_BANNER_5.getKey() + id));
        model.addAttribute(RedisEnum.APP_BANNER_6.getKey(), redisService.get(RedisEnum.APP_BANNER_6.getKey() + id));
        model.addAttribute(RedisEnum.APP_BANNER_7.getKey(), redisService.get(RedisEnum.APP_BANNER_7.getKey() + id));
        model.addAttribute(RedisEnum.APP_BANNER_8.getKey(), redisService.get(RedisEnum.APP_BANNER_8.getKey() + id));
        model.addAttribute(RedisEnum.APP_BANNER_9.getKey(), redisService.get(RedisEnum.APP_BANNER_9.getKey() + id));
        //插屏 (金/红记录)
        model.addAttribute(RedisEnum.APP_TABLE_PLAQUE_RECORD.getKey(), redisService.get(RedisEnum.APP_TABLE_PLAQUE_RECORD.getKey() + id));
        model.addAttribute(RedisEnum.APP_TABLE_PLAQUE_0.getKey(), redisService.get(RedisEnum.APP_TABLE_PLAQUE_0.getKey() + id));
        model.addAttribute(RedisEnum.APP_TABLE_PLAQUE_1.getKey(), redisService.get(RedisEnum.APP_TABLE_PLAQUE_1.getKey() + id));
        model.addAttribute(RedisEnum.APP_TABLE_PLAQUE_2.getKey(), redisService.get(RedisEnum.APP_TABLE_PLAQUE_2.getKey() + id));
        model.addAttribute(RedisEnum.APP_TABLE_PLAQUE_3.getKey(), redisService.get(RedisEnum.APP_TABLE_PLAQUE_3.getKey() + id));
        model.addAttribute(RedisEnum.APP_TABLE_PLAQUE_4.getKey(), redisService.get(RedisEnum.APP_TABLE_PLAQUE_4.getKey() + id));
        model.addAttribute(RedisEnum.APP_TABLE_PLAQUE_5.getKey(), redisService.get(RedisEnum.APP_TABLE_PLAQUE_5.getKey() + id));
        model.addAttribute(RedisEnum.APP_TABLE_PLAQUE_6.getKey(), redisService.get(RedisEnum.APP_TABLE_PLAQUE_6.getKey() + id));
        model.addAttribute(RedisEnum.APP_TABLE_PLAQUE_7.getKey(), redisService.get(RedisEnum.APP_TABLE_PLAQUE_7.getKey() + id));
        model.addAttribute(RedisEnum.APP_TABLE_PLAQUE_10.getKey(), redisService.get(RedisEnum.APP_TABLE_PLAQUE_10.getKey() + id));
        model.addAttribute(RedisEnum.APP_TABLE_PLAQUE_11.getKey(), redisService.get(RedisEnum.APP_TABLE_PLAQUE_11.getKey() + id));
        //代理推广佣金
        model.addAttribute(RedisEnum.PROXY_PROMOTION_COMMISSION.getKey(), redisService.get(RedisEnum.PROXY_PROMOTION_COMMISSION.getKey() + id));
        //免费短剧解锁N集
        model.addAttribute(RedisEnum.PLAYLET_FREE_SET.getKey(), redisService.get(RedisEnum.PLAYLET_FREE_SET.getKey() + id));
        //爱文科技定位公钥
        model.addAttribute(RedisEnum.LOCATION_AWKJ_PUBLIC_KEY.getKey(), redisService.get(RedisEnum.LOCATION_AWKJ_PUBLIC_KEY.getKey() + id));
        //双开（APP拦截）
        model.addAttribute(RedisEnum.RISK_DOUBLE_OPEN_APP.getKey(), redisService.get(RedisEnum.RISK_DOUBLE_OPEN_APP.getKey() + id));
        //双开（后台风控）
        model.addAttribute(RedisEnum.RISK_DOUBLE_OPEN_BACKSTAGE.getKey(), redisService.get(RedisEnum.RISK_DOUBLE_OPEN_BACKSTAGE.getKey() + id));
        //模拟器（APP拦截）
        model.addAttribute(RedisEnum.RISK_SIMULATOR_APP.getKey(), redisService.get(RedisEnum.RISK_SIMULATOR_APP.getKey() + id));
        //模拟器（后台风控）
        model.addAttribute(RedisEnum.RISK_SIMULATOR_BACKSTAGE.getKey(), redisService.get(RedisEnum.RISK_SIMULATOR_BACKSTAGE.getKey() + id));
        //开发者模式（APP拦截）
        model.addAttribute(RedisEnum.RISK_DEVELOPER_MODE_APP.getKey(), redisService.get(RedisEnum.RISK_DEVELOPER_MODE_APP.getKey() + id));
        //开发者模式（后台风控）
        model.addAttribute(RedisEnum.RISK_DEVELOPER_MODE_BACKSTAGE.getKey(), redisService.get(RedisEnum.RISK_DEVELOPER_MODE_BACKSTAGE.getKey() + id));
        //USB调试（APP拦截）
        model.addAttribute(RedisEnum.RISK_DEBUG_MODE_APP.getKey(), redisService.get(RedisEnum.RISK_DEBUG_MODE_APP.getKey() + id));
        //USB调试（后台风控）
        model.addAttribute(RedisEnum.RISK_DEBUG_MODE_BACKSTAGE.getKey(), redisService.get(RedisEnum.RISK_DEBUG_MODE_BACKSTAGE.getKey() + id));
        //root权限（APP拦截）
        model.addAttribute(RedisEnum.RISK_ROOT_APP.getKey(), redisService.get(RedisEnum.RISK_ROOT_APP.getKey() + id));
        //root权限（后台风控）
        model.addAttribute(RedisEnum.RISK_ROOT_BACKSTAGE.getKey(), redisService.get(RedisEnum.RISK_ROOT_BACKSTAGE.getKey() + id));
        //无障碍模式（APP拦截）
        model.addAttribute(RedisEnum.RISK_ACCESSIBILITY_APP.getKey(), redisService.get(RedisEnum.RISK_ACCESSIBILITY_APP.getKey() + id));
        //无障碍模式（后台封号）
        model.addAttribute(RedisEnum.RISK_ACCESSIBILITY_BACKSTAGE.getKey(), redisService.get(RedisEnum.RISK_ACCESSIBILITY_BACKSTAGE.getKey() + id));
        //IP代理模式（APP拦截）
        model.addAttribute(RedisEnum.RISK_ID_PROXY_APP.getKey(), redisService.get(RedisEnum.RISK_ID_PROXY_APP.getKey() + id));
        //IP代理模式（后台封号）
        model.addAttribute(RedisEnum.RISK_ID_PROXY_BACKSTAGE.getKey(), redisService.get(RedisEnum.RISK_ID_PROXY_BACKSTAGE.getKey() + id));
        //APP名称
        model.addAttribute(RedisEnum.APP_NAME.getKey(), redisService.get(RedisEnum.APP_NAME.getKey()));
        //QQ交流群
        model.addAttribute(RedisEnum.APP_QQ_COMMUNICATION_GROUP.getKey(), redisService.get(RedisEnum.APP_QQ_COMMUNICATION_GROUP.getKey() + id));
        //微信客服
        model.addAttribute(RedisEnum.APP_QQ_CUSTOMER_SERVICE.getKey(), redisService.get(RedisEnum.APP_QQ_CUSTOMER_SERVICE.getKey() + id));
        //今日同一个IP允许登录N次
        model.addAttribute(RedisEnum.RISK_IP_LOGIN_NUMBER.getKey(), redisService.get(RedisEnum.RISK_IP_LOGIN_NUMBER.getKey() + id));
        //今日同一个网段允许访问N个账号
        model.addAttribute(RedisEnum.RISK_IP_SAME_NETWORK.getKey(), redisService.get(RedisEnum.RISK_IP_SAME_NETWORK.getKey() + id));
        //今日广告总金币允许N金币
        model.addAttribute(RedisEnum.RISK_ADVERTISING_COINS.getKey(), redisService.get(RedisEnum.RISK_ADVERTISING_COINS.getKey() + id));
        //今日广告总金币N次平均值小于等于N金币（封号）
        model.addAttribute(RedisEnum.RISK_ADVERTISING_COINS_THAN_EQUAL.getKey(), redisService.get(RedisEnum.RISK_ADVERTISING_COINS_THAN_EQUAL.getKey() + id));
        //今日广告总金币N次大于N金币小于等于N金币
        model.addAttribute(RedisEnum.RISK_ADVERTISING_COINS_THAN_EQUAL_TWO.getKey(), redisService.get(RedisEnum.RISK_ADVERTISING_COINS_THAN_EQUAL_TWO.getKey() + id));
        //用户ID白名单
        model.addAttribute(RedisEnum.RISK_WHITE_LIST.getKey(), redisService.get(RedisEnum.RISK_WHITE_LIST.getKey() + id));
        //应用黑名单
        model.addAttribute(RedisEnum.RISK_APP_BLACK_LIST.getKey(), redisService.get(RedisEnum.RISK_APP_BLACK_LIST.getKey() + id));
        //KaKu
        model.addAttribute(RedisEnum.TA_KU.getKey(), redisService.get(RedisEnum.TA_KU.getKey() + id));
        model.addAttribute(RedisEnum.GRO_MORE.getKey(), redisService.get(RedisEnum.GRO_MORE.getKey() + id));
        //小视频
        model.addAttribute(RedisEnum.GM_VIDEO.getKey(), redisService.get(RedisEnum.GM_VIDEO.getKey() + id));
        //短剧
        model.addAttribute(RedisEnum.GM_SHORT_PLAY.getKey(), redisService.get(RedisEnum.GM_SHORT_PLAY.getKey() + id));
        //首页
        model.addAttribute(RedisEnum.APP_HOME.getKey(), redisService.get(RedisEnum.APP_HOME.getKey() + id));
        //分类
        model.addAttribute(RedisEnum.APP_CLASSIFICATION.getKey(), redisService.get(RedisEnum.APP_CLASSIFICATION.getKey() + id));
        //答题获取奖励（等待时间/毫秒）
        model.addAttribute(RedisEnum.TIME_INTERVAL_ANSWER.getKey(), redisService.get(RedisEnum.TIME_INTERVAL_ANSWER.getKey() + id));
        //答题错误（等待时间/毫秒）
        model.addAttribute(RedisEnum.TIME_INTERVAL_ANSWER_ERROR.getKey(), redisService.get(RedisEnum.TIME_INTERVAL_ANSWER_ERROR.getKey() + id));
        //答题领取奖励（等待时间/毫秒）
        model.addAttribute(RedisEnum.TIME_INTERVAL_ANSWER_RECEIVE.getKey(), redisService.get(RedisEnum.TIME_INTERVAL_ANSWER_RECEIVE.getKey() + id));
        //允许绑定相同支付宝Ｎ个
        model.addAttribute(RedisEnum.BIND_ZFB.getKey(), redisService.get(RedisEnum.BIND_ZFB.getKey() + id));
        //风控单清
        model.addAttribute(RedisEnum.RISK_SINGLE_CLEAR.getKey(), redisService.get(RedisEnum.RISK_SINGLE_CLEAR.getKey() + id));
        //风控双清
        model.addAttribute(RedisEnum.RISK_SHUANG_QING.getKey(), redisService.get(RedisEnum.RISK_SHUANG_QING.getKey() + id));
        //微信授权登录APPID
        model.addAttribute(RedisEnum.WX_LOGIN_APP_ID.getKey(), redisService.get(RedisEnum.WX_LOGIN_APP_ID.getKey()+id));
        //微信授权登录APPSecret
        model.addAttribute(RedisEnum.WX_LOGIN_APP_SECRET.getKey(), redisService.get(RedisEnum.WX_LOGIN_APP_SECRET.getKey()+id));
        //文件存储地址
        model.addAttribute(RedisEnum.FILE_STORAGE_ADDRESS.getKey(), redisService.get(RedisEnum.FILE_STORAGE_ADDRESS.getKey()));
        //文件下载地址
        model.addAttribute(RedisEnum.FILE_DOWNLOAD_ADDRESS.getKey(), redisService.get(RedisEnum.FILE_DOWNLOAD_ADDRESS.getKey()));
        //副广竞价大于等于N金币，间隔N小时
        model.addAttribute(RedisEnum.BIDDING_DEPUTY_GUANG.getKey(), redisService.get(RedisEnum.BIDDING_DEPUTY_GUANG.getKey() + id));
        //提现会员
        model.addAttribute(RedisEnum.WITHDRAWAL_WHITE_LIST.getKey(), redisService.get(RedisEnum.WITHDRAWAL_WHITE_LIST.getKey() + id));
        model.addAttribute("uvChannel", id);
        return prefix + "/configuration";
    }

    /**
     * 查询常规配置列表
     */
    @RequiresPermissions("manage:configuration:list")
    @ResponseBody
    @GetMapping("/list")
    public TableDataInfo list(BaseEntity baseEntity) {
        startPage();
        EntityWrapper entityWrapper = new EntityWrapper();
        entityWrapper.like("mark", baseEntity.getSearchValue());
        List<Configuration> list = configurationService.selectList(entityWrapper);
        return getDataTable(list);
    }

    /**
     * 新增常规配置
     */
    @RequiresPermissions("manage:configuration:add")
    @GetMapping("/add")
    public String add() {
        return prefix + "/add";
    }

    /**
     * 修改常规配置
     */
    @RequiresPermissions("manage:configuration:edit")
    @GetMapping("/edit/{id}")
    public String edit(@PathVariable("id") Integer id, Model model) {
        Configuration configuration = configurationService.selectById(id);
        model.addAttribute("configuration", configuration);
        return prefix + "/edit";
    }

    /**
     * 保存常规配置
     */
    @RequiresPermissions("manage:configuration:save")
    @PostMapping("/save")
    @ResponseBody
    public Message save(Configuration configuration) {
        EntityWrapper<Configuration> entityWrapper = new EntityWrapper<>();
        Configuration en = new Configuration();
        en.setKey(configuration.getKey());
        entityWrapper.setEntity(en);
        Configuration configurationResult = configurationService.selectOne(entityWrapper);
        if (ObjectUtil.isNull(configurationResult)) {
            if (configurationService.insert(configuration)) {
                redisService.set(configuration.getKey(), configuration.getValue());
                return Message.success();
            } else {
                return Message.error();
            }
        }
        configuration.setId(configurationResult.getId());
        redisService.remove(configuration.getKey());
        if (configurationService.updateById(configuration)) {
            redisService.set(configuration.getKey(), configuration.getValue());
            return Message.success();
        }
        return Message.error();

    }

    /**
     * 删除常规配置
     */
    @RequiresPermissions("manage:configuration:remove")
    @PostMapping("/remove/{id}")
    @ResponseBody
    public Message remove(@PathVariable("id") Integer id) {
        Configuration configuration = configurationService.selectById(id);
        if (ObjectUtil.isNotNull(configuration)) {
            redisService.remove(configuration.getKey());
        }
        if (configurationService.deleteById(id)) {
            return Message.success();
        }
        return Message.error();
    }

    /**
     * 批量删除常规配置
     */
    @RequiresPermissions("manage:configuration:batchRemove")
    @PostMapping("/batchRemove")
    @ResponseBody
    public Message remove(@RequestParam("ids[]") Integer[] ids) {
        List list = new ArrayList();
        StringBuilder sb = new StringBuilder();
        for (Integer n : ids) {
            list.add(n);
            sb.append(n);
            sb.append(",");
        }
        redisService.remove(sb.toString());
        if (configurationService.deleteBatchIds(list)) {
            return Message.success();
        }
        return Message.error();
    }

}
